// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 修改用户 PUT /api/system/user */
export async function userEditUsingPUT(body: API.SysUser, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/user', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增用户 POST /api/system/user */
export async function userAddUsingPOST(body: API.SysUser, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/user', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 DELETE /api/system/user/${param0} */
export async function userRemoveUsingDELETE(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userRemoveUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { userIds: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/user/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据用户编号获取详细信息 GET /api/system/user/${param0} */
export async function userGetInfoUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userGetInfoUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/user/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 用户授权角色 PUT /api/system/user/authRole */
export async function userInsertAuthRoleUsingPUT(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userInsertAuthRoleUsingPUTParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/user/authRole', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据用户编号获取授权角色 GET /api/system/user/authRole/${param0} */
export async function userAuthRoleUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userAuthRoleUsingGETParams,
  options?: { [key: string]: any },
) {
  const { userId: param0, ...queryParams } = params;
  return request<Record<string, any>>(`/api/system/user/authRole/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 状态修改 PUT /api/system/user/changeStatus */
export async function userChangeStatusUsingPUT(
  body: API.SysUser,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/user/changeStatus', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取部门树列表 GET /api/system/user/deptTree */
export async function userDeptTreeUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userDeptTreeUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/user/deptTree', {
    method: 'GET',
    params: {
      ...params,
      params: undefined,
      ...params['params'],
    },
    ...(options || {}),
  });
}

/** 导出用户列表 POST /api/system/user/export */
export async function userExportUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userExportUsingPOSTParams,
  options?: { [key: string]: any },
) {
  return request<any>('/api/system/user/export', {
    method: 'POST',
    params: {
      ...params,
      'dept.params': undefined,
      ...params['dept.params'],
      params: undefined,
      ...params['params'],
      'roles[0].params': undefined,
      ...params['roles[0].params'],
    },
    ...(options || {}),
  });
}

/** 导入用户列表 POST /api/system/user/importData */
export async function userImportDataUsingPOST(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userImportDataUsingPOSTParams,
  body: string,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/system/user/importData', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取用户模板 POST /api/system/user/importTemplate */
export async function userImportTemplateUsingPOST(options?: { [key: string]: any }) {
  return request<any>('/api/system/user/importTemplate', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 获取用户列表 GET /api/system/user/list */
export async function userListUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.userListUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.TableDataInfo>('/api/system/user/list', {
    method: 'GET',
    params: {
      ...params,
      'dept.params': undefined,
      ...params['dept.params'],
      params: undefined,
      ...params['params'],
      'roles[0].params': undefined,
      ...params['roles[0].params'],
    },
    ...(options || {}),
  });
}

/** 重置密码 PUT /api/system/user/resetPwd */
export async function userResetPwdUsingPUT(body: API.SysUser, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/system/user/resetPwd', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
